package pl.nazaweb.imedproplus.upload;

import java.io.IOException;
import javax.ejb.EJB;
import javax.servlet.annotation.WebServlet;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import pl.nazaweb.imedproplus.business.service.Icd9Service;

@WebServlet(loadOnStartup = 1, urlPatterns = "/upload/icd9/*")
public class Icd9UploadServlet extends UploadServlet {

    @EJB
    private Icd9Service icd9Service;

    @Override
    void doAfterFileSave(String fileName) throws ParserConfigurationException, SAXException, IOException {
        this.icd9Service.loadIcd9DictionaryToDatabase(fileName);
    }
}
